/*
 * @Author: Snitro
 * @Date: 2021-02-23 09:48:45
 * @LastEditors: Snitro
 * @LastEditTime: 2021-02-23 14:49:25
 * @Description: tm1637 驱动
 */

#ifndef __TM1637_H
#define __TM1637_H

//修改为所用型号
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_gpio.h"
#include "i2c.h"

#define TM1637_GRID_1 ((uint8_t)(1<<0))
#define TM1637_GRID_2 ((uint8_t)(1<<1))
#define TM1637_GRID_3 ((uint8_t)(1<<2))
#define TM1637_GRID_4 ((uint8_t)(1<<3))
#define TM1637_GRID_5 ((uint8_t)(1<<4))
#define TM1637_GRID_6 ((uint8_t)(1<<5))
#define TM1637_GRID_ALL ((uint8_t)0xFF)

#define TM1637_Settings ((uint8_t)0x40)
#define TM1637_Settings_Address_ADD ((uint8_t)0)
#define TM1637_Settings_Address_FIX ((uint8_t)0x04)
#define TM1637_Settings_Read ((uint8_t)0x02)
#define TM1637_Settings_Write ((uint8_t)0)

HAL_StatusTypeDef TM1637_Mod(uint8_t);
HAL_StatusTypeDef TM1637_Light(uint8_t);
HAL_StatusTypeDef TM1637_Display(uint8_t, uint8_t*);

#endif